package com.flashextended.apps.logomaker.demologo
{
	import com.flashextended.apps.logomaker.beans.workareaobjects.ImageOnStage;
	import com.flashextended.apps.logomaker.beans.workareaobjects.SymbolOnStage;
	import com.flashextended.apps.logomaker.beans.workareaobjects.TextOnStage;
	import com.flashextended.apps.logomaker.singleton.AppControl;
	import com.flashextended.apps.logomaker.singleton.AppLocales;
	import com.flashextended.utils.server.assetloader.LoadExternalAsset;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Loader;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	
	public class DemoLogo
	{
		[Embed(source="../assets/initialsymbol/symbol_4bc6289d8da56.swf")]
		public var LogoCls:Class;
		
		[Embed(source="../assets/applogo/initiallogo.png")]
		private var InitialLogo:Class;		
		
		private var timer:Timer;
		
		public function DemoLogo()
		{
			timer = new Timer(1000, 1);
			timer.addEventListener(TimerEvent.TIMER, addDemoLogo);
			timer.start();
		}
		
		public function addDemoLogo(e:TimerEvent):void
		{
			timer.stop();
			timer.removeEventListener(TimerEvent.TIMER, addDemoLogo);

			var bmp:Bitmap = new InitialLogo();
			
			var imageOnStage:ImageOnStage = new ImageOnStage(bmp);
			imageOnStage.width = 107;
			imageOnStage.height = 92;
			//imageOnStage.symbolColor = 0x006633;
			
			AppControl.getInstance().workarea.addObject(imageOnStage);
			imageOnStage.move(AppControl.getInstance().workarea.width/2 - imageOnStage.width/2, AppControl.getInstance().workarea.height/2-imageOnStage.height/2-70);
			
			var textOnStageFirst:TextOnStage = new TextOnStage("GreenCompany");
			textOnStageFirst.fontType = 1;
			textOnStageFirst.width = 258;
			textOnStageFirst.height = 46;
			textOnStageFirst.fontSize = 34;
			textOnStageFirst.fontBold = true;
			
			var textOnStageSecond:TextOnStage = new TextOnStage("for a better world");
			textOnStageSecond.fontType = 0;
			textOnStageSecond.width = 194;
			textOnStageSecond.height = 39;
			textOnStageSecond.fontSize = 20;
			textOnStageSecond.fontItalic = true;
			
			AppControl.getInstance().workarea.addObject(textOnStageFirst);
			textOnStageFirst.move(imageOnStage.x - 50, imageOnStage.y+85);
			AppControl.getInstance().workarea.addObject(textOnStageSecond);
			textOnStageSecond.move(textOnStageFirst.x, textOnStageFirst.y+33);
			AppControl.getInstance().workarea.unselectObjects();			
		}

	}
}